package de.rj.urwalking.util;

import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

/**
 * A utility class used to serialize the projection matrices.
 * Used instead of Simple XML built in converter functionality for the sake of
 * structural unity. For the sake of simplicity on server side, 16 floats are used
 * instead of an array, i.e. the elements and the column names are identical
 * @author mka
 *
 */
@Root(name="urw_projectionmatrix")
public final class UtilMatrix {
    @Element
    private final float m0;
    @Element    
    private final float m1;
    @Element    
    private final float m2;
    @Element    
    private final float m3;
    @Element
    private final float m4;
    @Element    
    private final float m5;
    @Element    
    private final float m6;
    @Element    
    private final float m7;
    @Element    
    private final float m8;
    @Element    
    private final float m9;
    @Element    
    private final float m10;
    @Element    
    private final float m11;
    @Element    
    private final float m12;
    @Element    
    private final float m13;
    @Element    
    private final float m14;
    @Element    
    private final float m15;     

	public UtilMatrix(com.threed.jpct.Matrix source){
		
		m0 = source.get(0,0);
		m1 = source.get(0,1);
		m2 = source.get(0,2);
		m3 = source.get(0,3);
		
		m4 = source.get(1,0);	
		m5 = source.get(1,1);
		m6 = source.get(1,2);
		m7 = source.get(1,3);
		
		m8 = source.get(2,0);
		m9 = source.get(2,1);
		m10 = source.get(2,2);
		m11 = source.get(2,3);
		
		m12 = source.get(3,0);
		m13 = source.get(3,1);
		m14 = source.get(3,2);
		m15 = source.get(3,3);
	}

}
